<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../js/echarts.js"></script>
    <script type="text/javascript" src="../assets/js/jquery-1.10.2.js"></script>
</head>
<body>
<div id="main" style="width: 2400px; height: 400px;"></div>
<script type="text/javascript">
	var prefix = ctx + "Main/main";
    var myChart = echarts.init(document.getElementById("main"));
    var url = prefix + "/test",
    $.getJSON(url).done(function(json) {
           var names = json.allData.names;
            var counts = json.allData.counts;

    var option = {
        title: {
            text: '电影排行前十'
        },
        tooltip:{},
        legend:{
            data:['票数'],
        },
        xAxis:{
            name:'电影名称',
            data:names
        },
        yAxis:{},
        series:[{
            name:'票数',
            type:'bar',
            data:counts
        }],
        toolbox:{

            show:true,
            feature:{
                mark:{
                    show:true
                },
                dataView:{
                    show:true,
                    readOnly:false
                },
                magicType:{
                    show:true,
                    Type:['line','bar']
                },
                restore:{
                    show:true
                },
                saveAsImage:{
                    show:true
                }
            }
        }
    }
    myChart.setOption(option);
    })


</script>


<form action="${pageContext.request.contextPath }/Movies/findAll" method="post">

    电影详情：
    <table width="100%" border=1>
        <tr>
            <td>电影名称</td>
            <td>电影网址</td>
            <td>评分</td>
            <td>评分人数</td>
            <td>上映年代</td>
            <td>备份</td>
        </tr>
        <c:forEach items="${moviesList}" var="movie">
            <tr>

                <td>${movie.movie_name }</td>
                <td>${movie.movie_url }</td>
                <td>${movie.score }</td>
                <td>${movie.evalue_usersr }</td>
                <td>${movie.year }</td>
                <td>${movie.other }</td>
            </tr>
        </c:forEach>
    </table>
